{% load humanize %}

<div class="panel panel-default question" question-id="{{ question.id }}">
  <div class="panel-heading">
    <h3 class="panel-title">
      {% if question.has_accepted_answer %}
        <span class="glyphicon glyphicon-ok"></span>
      {% endif %}
      <a href="{% url 'question' question.pk %}">{{ question.title }}</a>
    </h3>
  </div>
  <div class="panel-body clearfix">
    <div class="question-info">
      <div class="info">
        <h5><span class="glyphicon glyphicon-comment"></span>回答</h5>
        <span>{{ question.get_answers_count }}</span>
      </div>
      <div class="info">
        <h5><span class="glyphicon glyphicon-star"></span>同求</h5>
        <span>{{ question.favorites }}</span>
      </div>
    </div>
    <div class="question-user">
      <a href="{% url 'getuserinfo' question.user.id %}"><img src="{{ question.user.webuser.get_picture }}" class="img-circle" style='max-width:40px;'></a>
      <a href="{% url 'getuserinfo' question.user.id %}" class="username">{{ question.user.webuser.get_screen_name }}</a>
      <span class="asked">在{{ question.update_date|naturaltime }}提问</span>
    </div>
    <div class="question-description">
      {{ question.get_description_preview_as_markdown|safe }}
    </div>
    {% if question.get_tags %}
      <p>
        {% for tag in question.get_tags %}
          <span class="label label-primary">{{ tag }}</span>
        {% endfor %}
      </p>
    {% endif %}
  </div>
</div>